$(document).ready(function () {
	cont.onload();
	
  
})
var cont = (function () { 
	var wrongHtml="<i class='iconfont icon-delete_fill' style='color:#ff5621;font-size: 20px;position: relative;top:5px;'></i><span style='color:#ff5621'>请输入正确的格式</span><span style='color:#ff5621'>请输入正确的格式</span>";
	var rightHtml="<i class='iconfont icon-roundcheckfill' style='color:#1D9FFF;font-size: 20px;position: relative;top:5px;'></i>";
	var init = function(){
		$('.content').css("height",$(document).height() - $('.header').height() + 'px');
		$(window).resize(function(){
	       	$('.content').css("height",$(document).height() - $('.header').height() + 'px');
	    });
		$("input[type='text']") .each(function() {
	    	$(this).focus(function() {
	        	$(this).removeClass('wrong').addClass('right');
	        }).blur(function() {
	        	$(this).removeClass('right').addClass('wrong');
	        })
		});
		$("input[type='password']") .each(function() {
	    $(this).focus(function() {
	        	$(this).removeClass('wrong').addClass('right');
	       }).blur(function() {
	        	$(this).removeClass('right').addClass('wrong');
	       })
		})
	}
	var msgShow = function(dom){
		$(dom).css('border','1px solid #ff5621');
		$(dom).next().html(wrongHtml);
		$(dom).next().css("display","block");
	}
	return {
		onload:function(){
			var curSeg = cont;
			init();
			/*cont.alertBox();*/
			cont.closeBox();
			cont.alertBoxXy();
		},
		/*点击增加弹出框封装*/
		alertBox:function(dom){
     		layui.use('layer', function(){
				var layer = layui.layer;
				layer.open({
					title:["用户注册协议","font-size: 16px;font-weight: bold;text-align:center;"],
				  	type: 1,
				  	area: ['900px', '400PX'],
				  	content: $(dom) //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
				});
			}); 
     	},
     	/*关闭弹出框*/
	    closeBox:function(){
			$('.wep_save_btn').on('click',function(){
				layer.closeAll();
			})
	    },
	     /*点击增加弹出框*/
	    alertBoxXy:function(){
	     	$('#xy').on('click',function(){
				cont.alertBox('.zyq_xy');
				setTimeout(function(){
					$(document).find("#layui-layer1").css("overflow","hidden");
				},100)
	     	})
	     }
	}
})();
